#ifndef USER_REGISTER_WIDGET_H
#define USER_REGISTER_WIDGET_H

#include <QDialog>
#include "ui_user_register_widget.h"
#include "tcp_client.h"

class UserLoginWidget;

namespace Ui {
class UserRegisterWidget;
}

class UserRegisterWidget : public QDialog
{
    Q_OBJECT

public:
    explicit UserRegisterWidget(QWidget *parent = nullptr, std::shared_ptr<tcp_client> client = nullptr);
    ~UserRegisterWidget();

    int onUserRegisterResponse(int result, const QString &responseMsg);

private:
    int onUserRegister(const QString &username, const QString &passwd);
    std::shared_ptr<UserLoginWidget> userLoginWgtPtr_;
    std::shared_ptr<tcp_client> clientPtr;

    Ui::UserRegisterWidget *ui;
};

#endif // USER_REGISTER_WIDGET_H
